Fixed some errors and added herrorbar function (taken from
 http://www.mathworks.it/matlabcentral/fileexchange/3963-herrorbar).