Add test and correct rule target parsing