Update the integer casting to avoid matching trailing 0

A numeric string starting with a 0 should not be casted to an integer as this is loosing some chars. This is causing issues for some cases, for instance when entering a phone number in a field