add process location rules after entities

Also make sure the location is set

fixes #1919
closes #1149, 2062