A lot of minor bug fixes. Started working on something bigger so commit now.