This fixes some Linux build failures.
Part two needs a tidy-up which will come in a bit. But this is how I got the correct answer.