BugFix - Text element with no text rising exception

I opened an issue last week, but im new in contributing with open source projects and very newbie at GIT, so i dont know if I'm doing it right, but I fixed that issue and some compilation warnings and I'd like to provide this work to the people the uses this library.