Fixed the null case bug.