Fix stack calc