Fixed a bug where entities that didn't exist would throw an exception instead of being caught and printing a meaningful error.