Fixes to improve readability, exception handling, and IE11 support.