Removed duplicate code
Workaround for exception caused by Python-bug
Added option to permanently set view mode for sections