fixes null keystore bug, clears some UI stuff