Fix empty foreach and tidy up styling