fix a stack-overflow bug in List.transpose