Fix ! operation and add checks for invalid parameters on functions with multiple bodies