tests and fixes, coverage up to 77

Change-Id: I6f197efeebbb2c7622073e568e00c7504dd51737