Adding tests for errors