Fix wrong placement of guard + a bit of whitespace cleanup