Make geometry code compilable. Small modification in flow