A lot of fixes