More null/undefined fixes

javascript is weird