Minimal changes to get it to compile (a few taken from David Given ack-6.0pre5)