Fixed inconsistent usage of elseif