Fixed infinite build loop
Lots of changes