Better deal with invalid scroll ids.

Closes #5738