Further error fixing plus removed weird lines inserted by git