Replace tabs with spaces.
Switch to using SQL placeholders. SQL and values are unchanged.
Fix #2 by checking for -nan as well as nan (Not A Number).