Fixed up renderer code