Fixed errors caused by github UI, code cleaning, fixes