Fixed bugs from the merge.