Fixed so that script exits when usage is incorrect