Added tests and fixes for choosedouble, choosefloat, chooseint. fixes #2

Reopening the previous pull request.