Fix some formatting, and use inLoop() when appropriate.