Updated checks for keys