Improve content errors and fix access violation

Directory name and needed space was only provided when there was not enough space, but the size was always computed, thus causing an access violation.
Also added better error messages.