added 'this' check for prepared statements (#353)

To address #353, I included a HasInstance check in every function using args.This()