Add missing toStack method