Fix some python expansion test

Sorry for taking a while, but this should fix it :) Please let me know what you think!