Fixes regression with phantomjs, revert 00747d8df822d259acce7f8e3103c55b11a9b114