To avoid unwanted emoticons, use the filter-noemote class like so:
Alternatively, the code tag works as well:
Unfortunately, the problem with <a is a bit harder to fix. There is a filter-nohtml but due to how it is implemented, it still parses HTML but just converts it to text afterwards. This means that stray <a tags (or <b tags for that matter) will still cause errors.