fixed some compile-time bugs, the resampler seems to work fine but now
the painter crashes.