various bug fixes; first pass at fixing deletion of parent directories; does not pass tests