bug fixes; still not in a working state for github commits.