some slight code fixes