Fixed bugs that resulted from the merge.