Bug Fixes

* Remove unnecessary Math
* Only apply this logic to buffers we can edit via the main thread,
ignore background and read-only buffers