Fixed int parsing problem

Added a function that properly parses an int from a string with leading
zeroes. Firefox was parsing '0024' as 20 (octal).