Fixed up some things

Tidied up loose ends of undocumented functions, etc.