Fix target handling