Improved handling for missing or malformed rules