Fixed some problems with generated markup