make a few small fixes
Make a few fixes to handle nil values where arrays should be.