bunch of fixes