Corrected function name.
Fixed error introduced in recent commit - also check the value of $readOnly and not existance only.