pi fixes. hopefully didn't break the mac too badly