Various improvement

Here are three commits for a few small improvements. Feel free to pick and choose.

I will put those in the unified branch as well.