Fix inconsistent usage of elseif