Added some basic input testing to require valid values before attempting a conversion.