More fixes! I think everything works, just need more testing!

Almost ready for merge!