Error checking for stack's pop(); cleanup