Ports fixed some bugs added validation

Change-Id: I79ba59de2926d9b540d66e37eaee2837a61e641a