Added Failures test and cleaned up serveral bugs