Fixed #1907

Reversed out #1883 since it was causing browsers to (easily) crash.

Also fixes #1911