Corrected code typo. Improved sections detection