Fixed a bug when GUID was empty. This is probably more reliable.