Much more error handling in jsloc.cpp and slight alteration to initLocationClass