Fix crash

Should introduce test for that one