Fixed use of local rectangle variables in upsample worker. Cleanup.