Fix transition function for df