unit tests + fixes to get unit tests passed