That should allow to obtain more meaningful error messages...I hope

Is the "elseif" necessary or can I remove it?