Fix issues with emacs built without GUI support