Added tests for error behaviour.