20140921_Obsolete File Fix

Due to my stupid knowledge, I've coded some essential source code as
~.h. So I fixed them. Also add some protection & debuging code.