Some small improvements

Still WIP, I wouldn't like to commit this, but I'm spending too much time trying to figure out what is happening with the encoding and brute force is not working. I need to ask in StackOverflow and it's very handy to upload the last version.