Changed pack functions to ensure that no empty raw or archive file is created. #603, #602

14 jobs for v0.10.7 in 29 minutes and 59 seconds (queued for 1 second)