Fixed some casts for Linux Compilation