Several Bug fixes/new Functionality

Haven't figured out how to work with different branches yet so its all 1 pull request.