PHP warning fix and option saving trick for pk.