More PHP notice/warnings data validation

Fixes PHP Notice: Undefined offset: X