Added better code for deciding if the supplied value should be an integer type or not.