MEGA BUG FIXES

CREDIT TO PAUL FOR HELPING DEBUG