Check for nil pointer in Beginx, Preparex.
Merge pull request #9 from cmars/master

Check for nil pointer in Beginx, Preparex.