Fix sale query Closes #2308.