Fix MODE handler crash