Security

I've made a few changes to get rid of security flaws. Be wary when merging, it's important that all user input, including from the owner, is cleaned.