Fix bug in SBOOKS. extraction and fixed scope of id resolution