Fix unsequenced write UB warning.
Add test target to run unit tests.