Apply fix from upstream pull #686 for ZCAGCD-349