safari fixes for king generator

note to self: safari hates global variables