Fix getCodeSnippet method for small files