(rm junk)
Error handling fixes and cleanups.