The fix is a bit of a hack but it seems to work. Fixes #4202. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>