Misc fixes, beginning of new architecture