Fix behavior of tabs. Last commit for issue #388