Fixed bug where registration cache directory is deleted