Merged latest patches from the master branch, improved plist memory handling.