do not build if not necessary for testing
fix parsing an if that ends at the function end