Merge of rebase and minor fixes