Fixed end of args detection bug