Bugfix + new features.

This hopefully fixes #447. I could not recreate this bug, please let me know more about the conditions if it still occurs.  Cheers!!

Edit: Also implemented features requests in #448 and some random stuff. Please let me know what you think. Cheers