Fixed for() loops to protect against evil Array-altering modules
Wrap JSON parsing in try..catch