Added missing test and fixed missing check in constructor

Change-Id: I5725fb5552cc09ee0ba5be63c807be113619844b
Merge "Added missing test and fixed missing check in constructor"