merged in a couple of fixes