Partly added fix from r5400 from /tags/modified-shop-1.06 to trunk (Rest was already included in trunk)