Modifications to allow tests to run in phantom