Updated archive.cpp functions for proper error handling