Fix to handle floats

Added new test also