Fix Issue #125, calling close twice failed.