fix some bugs to make GHC.Stack working