Fixes a null pointer exception introduced in last commit