Undo problems introduced in previous attempt to remove warnings
Put brackets back after for and if to comply with coding conventions