[spo_unified2] Added errors and cleanup functions