Eliminating Some "Notices"

$attributes variable is used again in the function, but in Joomla 3.2+ this variable is undefined, so in Item creation page, we get following Php Notices:
Notice: Undefined variable: attributes in path_to_root\administrator\components\com_k2\models\extrafield.php on line 324(and 347 and 355)