Fix conditonal and function call location