code optimization and remove redudant EOF detection
fix a bug in checkparams_trimspace() that wont convert NULL to null
fix a skip over size bug, add a test case for it, fix a bug in the call back function