Fixed logging in generated program