fixes and upstream merge

wow lotta shit
yea

asas