Fix unknown extensions handling. Thanks @xobbit for the report.