Added stdev function, fixed a few small issues