Fixed forgotten bug where segments were removed too early since their size wasn't considered.