Still undefined offset + non-object warnings