Fix coding standards issues

This fixes coding standards issues and [one minor potential bug](./4/files#diff-5cad01fe2787cfaf64a2b0b882d7a84dR154).