Ok, my fault. The error message trying Lesiok's code looked somehow different on my machine using Visual Studio.