Apply fix from magma to 3.8.13

Signed-off-by: Alec Ari <neotheuser@ymail.com>