There are/were two separate issues. It used to be that new orders were being matched with existing orders at the price specified in the new order. So if there was an existing offer to sell me bitcoins for 10 GBP each and I asked to buy some at 5000 GBP each, I would be charged 5000 GBP for them, rather than 10 GBP each. I made a patch for this and it was applied around the 26th or 27th of June:
June 26, 2011, 06:08:15 am
Merged dooglus's gitorious branch after testing it today.

June 27, 2011, 04:45:06 am
yep, it was done a little afterwards since phantom forgot to do it.
After that, new orders were initially matched at the price specified by existing orders, but if they were only partially matched, the "I have" and "I want" fields were updated by subtracting the amounts that were bought and sold by the initial trade. This leaves undesirable implied prices in the order, as I described in my recent post:
This is how very high priced trades happen:
User A has 5 BTC and wants 45 GBP (selling 5 BTC at 9 GBP/BTC)
User B has 51 GBP and wants 5.1 BTC (buying 5.1 BTC at 10 GBP/BTC)
User A's order goes in first, and is unmatched.
User B's order goes in 2nd, and is partially matched at User A's rate of 9 GBP/BTC.
User B gives 45 GBP to user A and gets 5 BTC in exchange.
User B now has 6 GBP and the 'wants' value is updated to 0.1 BTC.
User C can now come along and sell 0.1 BTC to User B for 6 GBP, at a price of 60 GBP/BTC even though the market price is in the range of 9 or 10 GBP/BTC.
Note that overall, User B gets 5+0.1=5.1 BTC for his 45+6=51 GBP, and so actually gets the price he was expecting to. It's just that some was better than expected (5 bought from A for 9 GBP each) and some was much worse than expected (0.1 bought from C for 60 GBP each).
Genjix claims that this "want" field isn't used, but it still is being used, and is the cause of this problem:
June 26, 2011, 12:58:18 pm
You're right, we do ignore the want field. It's mostly left for display and is kind of redundant. It's not even needed.
Now phantomcircuit asks for a 'specific order' showing the problem. It's hard to give specific details, since we don't have access to the britcoin database. All we can see are the trades that are published through the API:
Can you point me to a specific order in which the order was filled at a price neither party requested?
In the past the problem has been people putting in orders that were a terrible deal for themselves and them going through.
This "in the past" problem is the one that I fixed in my first patch, applied on June 26th or 27th. But bad trades have been happening since then to a lesser extent. Here's one:

I mentioned it in this post, and provided a fix:
Did anyone notice the recent trade at 45 pence per BTC?
Fri Jul 1 10:21:01 2011 9.889100 2.214555
Fri Jul 1 10:49:01 2011 9.889100 5.423131
Fri Jul 1 11:19:01 2011 9.881400 1.000000
Fri Jul 1 12:00:01 2011 0.446300 0.007894
Fri Jul 1 12:26:01 2011 10.000000 10.000000
Fri Jul 1 12:31:02 2011 10.000000 3.000000
Fri Jul 1 12:31:02 2011 10.000000 2.000000
I think this was caused by the code still using the updated want_amount database field.
I committed a fix for this a few days ago and mailed Genjix. The fix is here if anyone could look it over for me:
https://gitorious.org/~dooglus/intersango/dooglus-intersango/commit/126d05d8f23a2745da8db65fb57414eca607d0d8I don't have a copy of the orderbook at the time, but I really think it is unlikely that no buy orders were in the book for anything above 0.45 GBP when the price was around 10 GBP/BTC at the time.