Test and fix #42 catching native js errors