Fix the null assignment bug