Fixes for gem loading