added nanmean for bsl and fixed code dealing with checking data dimensions