Update and fix code layout
Fix code layout, fix tags support, fix minor bugs