a lot of fixes