Partial fixes for unit tests