Add more validations to avoid notices and warnings
Merge pull request #1274 from julceslauhub/master

Add more validations to avoid notices and warnings