Fixed some logic errors with executeProcedure() method.