Clean up and get tests passing in phantom