Modified various API functions, make it a little more strict.