Fixed a bug and increased code coverage.