Commit 6

More bug fixes. You can tell it's nearing the end of the day.