Rebase changes and error fixing