Fix console warnings

I made a bit refactoring to prevent warnings in my console.

3 commits - 3 problems

reference to #538