She grants the sailor one wish by making him captain, but note that the wish was for a nicer captain. That neatly avoids changing the captain’s personality. Then she pops herself back to the apartment.