Fixed invalid closing.

Signed-off-by: crynobone <crynobone@gmail.com>