Fixed a few bugs. Mostly final build.