Various fixes trying to get 'import random' to work