fix a load-constant bug, and correct some constant hoisting issues