Fixed some cursor bugs and added test for DynamicSectionMapping