Fix compile type error for duration