Fixed bugs from rebase confusion