Improve handling of invalid salts