Small fixes to allow this to work.