fixing wrong attributes in some edgecases.