Fixing tests, better error handling

:D Everyone is sleeping already!