show_bar(): Fixed a problem calculating $index