A couple of fixes and a cleaner interface