Fixing NPE with gem generation.