EDUBUG-1: fixed NPE and improved last folder selection