Fixed a compile error on MSVC < 2013

Thanks to Ind, Michieru

Signed-off-by: Haru <haru@dotalux.com>
Corrected a trivial null pointer case detected by Xcode

Signed-off-by: Haru <haru@dotalux.com>