Fix and add test