Fixed python bug