Fix strange output when a following segment is empty (fixes #101)

When searching for the next segment to base background coloring on, it
skips empty segments now.
Fix bug introduced when fixing #101
Merge remote-tracking branch 'scicalculator/fix_bug-101_empty-segment-bug'