Fix bug in invoke completion; clean up file