Seriously need to organize commits better. Lots of small changes, mostly bugfixes.