Improve GC finalisation code; add option to disable it.