Merge Freek's patch to support printfs that return ints.