Indeed it is supposed to be else if, not IF as Matthias stated.
WIP Start of a big refactoring