Fix warnings reported by clang

All these problems have the same root: the address of a reference can never be 0, and it does not make sense to test it.