Warning/error for non-positive weights; improved speed/memory use