A few bug fixes. Still some weird import errors going on sometimes...