a lot of different fixes