Bug Fix: Fixed stack check issues