Improvements and fixes

fixes a couple bugs and adds some usability improvements. Hopefully the commits should be self descriptive. If not i can go into more detail