Fixed an issue where invalid names caused an uncaught exception