fixed patches after upstream changes