Added checks for gems before they're required