Finished 0.3 code cleanup, two bug fixes