Fixes negative offset lengths