Changed the syntax of the script's invocation

fixed few minor bugs