fix several more issues which didn't raise an error earlier (don't konw why