My nifty pull request

This pull request contains a bunch of enhancements and bug-fixes, happily shared with you