Bugfix: incorrect number of raft layers was generated when too few were requested. #1678