Selective merge from Python Improved