Call cleanup for encoder