Fixed some of the reported bugs.

More will come when I receive the bug specification.