fix weird NULL comparison
fix unnecessary comma causing issue for some compilers