Yup, now it appears to compile through, thanks! Haven't tested Lionel's second patch yet, though (thanks, BTW!). Now running with Lionel patch 1 and this patch.
As Christian's solution is better than mine, what should be committed is the first revision of my patch + Christian's for the second problem.
Lionel