Fixed a lot of things

final commit for the night.