Bug fixes and changes to markup output