fix access to some undefined values