Better error handling for theme loading. Minor tweaks for emacs_template