Replaced beginning-of-buffer with goto-char (point-min)