Some fixes for autogenerating stuff