Handling arbitrary number of tabs.

Easy solution for issue #190.