updated unit tests for error code checking