Fix error message for unexpected message type