Couple bug fixes and another file cleanup