Made it more defensive of issue's with the custom types