fixed branch and file writing/reading bugs