Clear buffer-modified-p only when necessary.

- #9
Clean up end marker.