cleanups on bug checking