Fix position bug associated with all-selections, refactor helper functions, fix minor bug