Fixed main stack pointer bug