Fixing checking for route target for callable or closure