adding guard against potential error with rowMeans(...)
Merge pull request #764 from blawney/master

adding guard against potential error with rowMeans(...)