Fixing scrollspy bug where it wasn't always locking onto the right item