Find and fix trouble with buffer overflow