Fixed a bug where bad resource files led to an exception