Added PKI, minor updates

Added the option to log in using PKI, fixed some minor issues.