Fix for possible null/undefined reference