Prevent deleting 'uncategorized' category

Fix var def on prev commit

add tests & things