Minor fix for `checkIfStacked` function