Corrected errors found during tests

Change-Id: I151fa38d69acd0f51527c984ce95dad6a6455a93