First attempt at fixing return value semantics