Fixed keyword search for CATEGORY and some cleanups