Improve open_gem