Fix tests and target creation