More fixes for use in an extension.