Add tests for generated gems, fix a found bug