Fix new code layout bugs