Patches from SourceForge (and two other fixes)

Fixes for #159, #160 and #161. The equivalent SF bugs have been marked as closed.

Also includes two other fixes:
* Empty properties were being converted to type TEXT when the #define to allow empty properties was set.
* A negative UTC-OFFSET with seconds wasn't including the seconds correctly