ensure gems have a stable sort order
fix gem detection for (eval)