two bugfixes, thx grieferatwork