Merge some changes from [peter@kung-fu-tzu.ru] to fix wanings