minor bug fixes, last commit before starting to remove tabs