DEV: Implement directory deletion and more bugfixes.