Loop protect fixes

- [x] Fixed #1270 
- [x] Fixed #1325
- [ ] Fixed #1332 
- [ ] Fixed #1335