Added safe_unpack