Added check for null returns.