Close behavior

Working now on all OSes