fix some bugs due to stupid python3 *still* not having its shit together wrt bytes / str, and an import