Some fixes for unit tests