Fix 500 internal error

Fixes issue #6