Move safeguard code

Moved the DJ safeguard code inside a handler that actually gets the data
we were expecting. Bonus points because it happens even more frequently.

Also fixed indent formatting in utils.js because why not.