Holy crap it works.
Compilation and minor fixes.