Should be annotated with @tailrec, just to make sure.