#1048: Process review feedback

During code review a few points of feedback have emerged and while testing
with Yii I also found a bug that crashed parsing. All these points have
been fixed in this commit