Solving the same issue, but a bit different in trunk...