Fixes, unit tests