Fix bug when converting to seconds