Fixed #10, some clean up