Fixed a bug with connecting to categories
Moved some things around