Merge and some fixes