Add failing tests
Fix error handling