Fixed some major issues

Change-Id: I7f749f38eda4621daf537de616400785b7077ccb