Add test + small improvements