fixed pull requests from xaroth. modified a few lines.