Added backward compatibility with v2.5

This comment should also explain what the lines of code are doing. Easier to follow that way.