Fixed problems with buildscript

Signed-off-by: deathrat <deathrat43@gmail.com>
Merge pull request #110 from deathrat/1.6.2-code

Fixed problems with buildscript