[1.2.4] Backports of bug fixes from 1.3.0