Repair some bugs for work with new server version.