Bugfixes by @yying
Typos and stuff :)