Added exceptions for NaN, Inf and negative values