moved constant declaration to script header, fixed error reports