Better error handling, improved HTML rendering