Fixed some bugs. Plenty left.