bunch more fixes. (incomplete)