Fix bug where build folder is replaced more than once, closes #41