Fixed bugs dealing with special cases of numbers ie infinity 0.5 etc.