Floating point issues fix