Fixed bug in deleteDir(). Added tests