Fix stack count fetching