update mgrast token usage and some bug fixes