More bugfixes + significant changes to range function. It is now 99% accurate, the other 1% being some bugs that may still exist, but that I'm not aware of.