Make passing discount codes in query string more reliable.

#2455