compile in debug mode, use correct indexing function