Fixed up the last little few things. Some minor bugs, some references, and more commenting