Fixed a few bugs left over from merging.