Merge some changes from trunk