Fixed `SystemStackError: stack level too deep' issue

Files without extension cause "SystemStackError: stack level too deep" error