Small fix to prevent nul pointer exceptions