Fix test and edgecases