Fixed up some doc code and exceptions