Big bunch of fixes and nice changes