small fixes, test coverage improvement