[#3] Fix query string replace function for more cases