Compile fixes (and size optimisation)