Fixes profile problem for queries starting with OPTIONAL MATCH