Fixes #1141

Any errors will be properly handled.