add some special function tests, fix errors