Fix issues in script so it runs in cygwin

Signed-off-by: Igor Popov <igor.popov@napa.fi>