additional checks in code
fixes for tests