Basic tests added, functionality fixes