Add tests for error handling and command execution