Three fixes from Daniel Krügler