Fixed javascript parsing of query string