Reversed the boolean expression to make it more readable
Add guard against needlessly changing shell