Repair small mistake in previous commit.
Fixed an if/elif which shouldn't change much except maybe a small optimisation.