Fixed undocumented bugs as well as bug #77