Fix "complete is undefined" errors