added tweaks to handle a collection of zero
Added templates