Improved some code, removed deprecated calls, secure string-usages.