Fix containership corner cases, improve tests