Small changes to prevent PHP errors

Gracias para este plugin :)

...and that's the limit of my Spanish skills, sorry. I was getting some PHP errors with this plugin, the changes here fix those.