Fix atexit call