Major enhacements

Power failiure, directory fix