some tweaks to get pypy working