merge a bunch of fixes