Fixed lots of warnings and notices

Also added JS close button to categories