Use bindParam to handle null, int and bool values better, resolves #196