Better error codes

Tried it, doesn't work properly.