Coding style
Prevent division by zero
Hide scroll indicator when there's no need for it