Default error code to 500

[fixes #18]