Merge pull request #4004 from sahiljain/fix-3909

Return error when full string cannot be parsed into int