Replace end-of-buffer and beginning-of-buffer