Got rid of some corner case bugs.