A fix for various dox issues and a bug in the dox system

#185 #178 #167 #149