add S3 segment move test and fix bug caught by test