Fix exception when nil