fix subtle layout bugs