Fix PHP notices - uses "isset()" before de-referencing variables