It looks that when I download .mq5 file and compile it with MetaEditor (build 1940), it works every time. Only when I download it from the server it fails sometimes. So I uploaded build 1940 on the server, but for some reason it still doesn't work. The compiled files should be the same, but who knows. On the server I am using the command-line version of the compiler, maybe there are some differences.