Boatload of bug fixes

Pretty much what the title says.... fixes a bunch of bugs and issues.