fix test suite for real browsers

The test suite fails in firefox and chrome for different reasons. This fixes all of them!