Fixes #5153

Fixed indentation issues and removed curly braces from if.