Fixed a few minor bugs in last commit.