Tighten up a couple of type annotations

These functions never return null so mark their return types as non-nullable.