Modifications to support old library versions. Apply this to v0.25.0 with current released library versions.