Fixing issues after upstream merge