Bug fix to render texture