small code fixes

thx sigkill