Removed some debug logging and added tests.