After calculating i (offset in list to top of window), if it's less than zero, apply it to bar and set i = 0. Fixes #218