Several fixes

Several fixes due to objc evolution or behavior problem.