Fix some of Stephan's patches.