Fixed handling of keyfile subdir creation
Improved keyfile subdir deletion (1 bug remains here)