Improved spring implementation/ fixed encoding problems/fixed html generation problems in certain cases