Fixed a few bugs from the merge.