Various bugfixes (floating point comparisions and logical)