Fix indentation and add comments for checkExtensionKey