some fixes for the code

some good n8 fixes for the code, mostly ids.