Ensure the bulkInsert returns an instance of Result
Minor cleanup to avoid php notices

* Ensure the $result variable exists
* Use substr() to check the first character of a string