Change how targets are handled, and update tests accordingly