Cast GL emulation matrix version numbers back to integers after increment. Code cleanup and clarify comments.