Fix bad usage of error types
Fix bad usage of error types