Several crash fixes plus PLIST_API for static library linkage.