v1.3: quick bugfix. Ugly code :(