Improved error handling.
Removed requests to undefined JS_SPIN.
+ Other small improvements.