Protect NULL + Rename tmp defines