v1.2 changes copied to this branch