Bugfix: making sure all errors are returned as such in promises

Fixes #9.