explicitly set nick, remove unused import
fix detection of invalid keys