Fixed issue with comparing doubles