Add some tests for Error handling