Make tests pass in phantomjs

Change-Id: I0cb094b8a350b716cfb7b50ea6e370fd39fff1d6
Merge "Make tests pass in phantomjs"