Stricter validation of key