Switched around order of if statements.