small fix in mapAttributes

The code crashed for my network, because several attributes had NA value and index j changes when these were removed (resulting in removal of wrong attribute name).