Fix #14: Raise an exception on NaN and Infinity values and some logging improvements.