fix warnings about anonymous function not always returning a value.