Fixing nightly breakage

This is a first pass, still doesn't compile (fails in quite a strange way, suggestions are welcome)