Added check for arg size. Fix bug of not closing file when indent level was 0