Fixed issue #37

Added unit test and fixed issue #37.
(Also found a bug in iegap polyfill that was triggered with the new unit
test.)