Four patches as discussed in the mailing list

To make things easier I created a pull request for the stuff I have.