Fixed check for numeric value as proposed in issue #25

Added check for numeric value according to @zmogas patch in issue #25.