Only handle incoming commands if the length is valid.