Some minor cleanup to plugin API to prevent some unusual import problems.