Fixed a null reference exception that occurs when the publish:end:remote event fires the generator.