minor fixes. Added nanmean function.