Added support for checking to see if an attribute exists.
Some type fixes and NULL checking
Some credit changes