Consistent outputs in functions