massive bug fixes from build errors.

My bad.