Merge "Better activity resolution tests; AFD exceptions." into klp-dev