Fixed several errors.
Added manual tests for a few things.