Fix StackOverflow, Lots of new bugs