BIS-753: Merged the changes from master. Using Error objects instead of strings for errors in promises.