Removed some unused code and fixed a test failure