Fix Linux/Android compilation.
Fix some type conversion warnings.
Merge pull request #231 from unknownbrackets/thin3d

Fix Android/Linux compilation