It looks like the changes I made were conflicting so I've reinstated the category excluder plugin for the time being until I work it all out.