Fix bug introduced in 5998cbec8d causing a function to always return NULL