fixes #7191 and cleans up indenting some
more indenting