Fixed the bugs related to CFF & merged to upstream

changed