cleanup and correct mistakes in branch