Fixed small bugs introduced during refactoring

Change-Id: I4b82fd1459114f6a8a3ee73dd1bc55531f851429