Fixes for functions that return values