Fixed a few small bugs.

fixes #3