made param codes more consistent, and removed redundant checks against NULL.