Secure paths

- Trying to secure all paths, i think i got all, but it was changes to
so many files i might have missed some
- Some code cleanup