fix various layout problems