Added javascript alert error catcher. Fixes issue #1.