Fixed crash with getting duration in a wrong state.