Period::merge code improved