Fix logic error with add-line-if-not-exists
whitespace cleanup
whitespace cleanup