Apply Knut's patch, fixes broken statman integration