Fix gem loading dependency issues