Fix unused variable warnings.
Fix naive rounding logic affecting negative scaled values.