Minor fixes on exceptional cases

- Fixed crashes and memory leaks when tags cannot be loaded
- Added check for tag compatibility