Categories finished

various bug fixes