Fixed some bugs + compatibility with newer jQuery

- Fixed for jQuery v1.8+ / v2+
- Fixed handling of errors for older browsers (<=IE9, <=FF3), doesn't
stop whole script