various fixes, emacs config works from this point