minor bugfixes, categorical tables fully functional
merging back after amend