Fixes trimming when using end times