Fixed bug in which a directory had to be opened twice before loading.