WIP fixes for unit tests