Bugfix for broken tests

Fixed a bug in callback wrapping that seems to break a lot of tests (and general functionality).

Also, friendly tip to others struggling, the current versions of Chrome (beta and unstable) are a PITA to test on, so if you are looking for any kind of consistency when running tests, try Firefox.