rewrite tests to pass in chrome and firefox

fixes Issue #993