It seems that running EventStore command line this bit of code falls over. Further investigation needed, for now it has been removed and tested