Code layout fixes