Various fixes to layout after migration to MD