Fix various layout/behaviour bugs caused by recent changes