Fix bug with condition end time

This commit fixes issue #288