Applied Menne's fixes.