Added Residence protection + bug fixes