Fixed rebase bugs