Defog fixes

Comments should explain everything