Many many fixes and changes