Fixed some bugs from conflicting merges.