bug and layout fixes