Fix version check

Not all Erlang versions are of equal length. Added clauses to handle this.