More defensive programming, more NULL checks on pointers. Avoiding weird cases where setters are called unexpectedly. More example usage added to README.