Issue #122: Improved SQL and IDSEL