guh random fixes so it actually works with python3?
various more work on things