Tests for error cases