Fixed up indentation and added validation on keystore instead of NullPointer.