Markup issues

Fixed some issues with the markup... tidied up code. No other changes.