fixing php bugs in perseus