Fix `quickEncode`
Remove tracing, cleanup
Add unit tests