i think procstate.c has a problem (by searching for the first instead of the last closing brace), but I'm too lazy to fix it