Added DETERMINISTIC and RETURNS NULL ON NULL INPUT to most functions. 
Fixed a couple data types.