Fix crashes due to appearance of created unit. Also fixed invalid age generation.