Fixed a bug concerning an error when using float values.
Added the test cases to the unit test.