Improve error handling on invalid securities