Fixing things to pass tests
Fixed small error in error handler