Bugfix in rebase function.
Bugfix in rebase function.