Updated tempbug code (some small omissions)