backport fixes for create_module tool