Fixed build errors with local return values