Added input format check, fix css gen bug