Remove console.log line
Add in null array checks