some long overdue fixes
merge changes i made on github oops