Improved error checking and implemented location checking. Now ready for
alpha testing