added missing where clause when fetching command types
added null check when finding input validators