Some Unit Tests and modification cpu version