add a special check on PREVIEW var; and fixed two typos