Fixed bug with unit tests