added stricter checking for string types to integer