Corrected errors found during tests

Change-Id: I1be9237110297329e0a10cb5fcb743c4f1ad4dde