Updated  with B.H.'s fix.