Several minor fixes.
Dirty hack for inter-module dependency