diff --git a/compiler/cpp/src/thrift/generate/t_js_generator.cc b/compiler/cpp/src/thrift/generate/t_js_generator.cc
index fc23e87..f8f1bee 100644
--- a/compiler/cpp/src/thrift/generate/t_js_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_js_generator.cc
@@ -206,6 +206,7 @@
   std::string ts_includes();
   std::string ts_service_includes();
   std::string render_includes();
+  std::string render_ts_includes();
   std::string declare_field(t_field* tfield, bool init = false, bool obj = false);
   std::string function_signature(t_function* tfunction,
                                  std::string prefix = "",
@@ -287,7 +288,7 @@
    * TypeScript Definition File helper functions
    */
 
-  string ts_function_signature(t_function* tfunction, bool include_callback, bool optional_callback);
+  string ts_function_signature(t_function* tfunction, bool include_callback);
   string ts_get_type(t_type* type);
 
   /**
@@ -511,6 +512,27 @@
 }
 
 /**
+ * Renders all the imports necessary for including another Thrift program
+ */
+string t_js_generator::render_ts_includes() {
+  string result;
+
+  if (!gen_node_) {
+    return result;
+  }
+  const vector<t_program*>& includes = program_->get_includes();
+  for (size_t i = 0; i < includes.size(); ++i) {
+    result += "import " + make_valid_nodeJs_identifier(includes[i]->get_name()) + "_ttypes = require('./" + includes[i]->get_name()
+              + "_types');\n";
+  }
+  if (includes.size() > 0) {
+    result += "\n";
+  }
+
+  return result;
+}
+
+/**
  * Close up (or down) some filez.
  */
 void t_js_generator::close_generator() {
@@ -1117,7 +1139,7 @@
       f_service_ts_ << "/// <reference path=\"" << tservice->get_extends()->get_name()
                     << ".d.ts\" />" << endl;
     }
-    f_service_ts_ << autogen_comment() << endl << ts_includes() << endl << endl;
+    f_service_ts_ << autogen_comment() << endl << ts_includes() << endl << render_ts_includes() << endl;
     if (gen_node_) {
       f_service_ts_ << "import ttypes = require('./" + program_->get_name() + "_types');" << endl;
       // Generate type aliases
@@ -1219,9 +1241,9 @@
       }
       f_service_ts_ << "{" << endl;
       indent_up();
-      f_service_ts_ << ts_indent() << "private _handler: Object;" << endl << endl;
-      f_service_ts_ << ts_indent() << "constructor(handler: Object);" << endl;
-      f_service_ts_ << ts_indent() << "process(input: Thrift.TJSONProtocol, output: Thrift.TJSONProtocol): void;" << endl;
+      f_service_ts_ << ts_indent() << "private _handler: object;" << endl << endl;
+      f_service_ts_ << ts_indent() << "constructor(handler: object);" << endl;
+      f_service_ts_ << ts_indent() << "process(input: thrift.TProtocol, output: thrift.TProtocol): void;" << endl;
       indent_down();
     }
   } else {
@@ -1325,7 +1347,7 @@
   }
   if (gen_ts_) {
     indent_up();
-    f_service_ts_ << ts_indent() << "process_" << tfunction->get_name() << "(seqid: number, input: Thrift.TJSONProtocol, output: Thrift.TJSONProtocol): void;" << endl;
+    f_service_ts_ << ts_indent() << "process_" << tfunction->get_name() << "(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;" << endl;
     indent_down();
   }
 
@@ -1645,10 +1667,11 @@
     indent(f_service_) << "this._seqid = 0;" << endl;
     indent(f_service_) << "this._reqs = {};" << endl;
     if (gen_ts_) {
-      f_service_ts_ << ts_indent() << "private input: Thrift.TJSONProtocol;" << endl << ts_indent()
-                    << "private output: Thrift.TJSONProtocol;" << endl << ts_indent() << "private seqid: number;"
-                    << endl << endl << ts_indent()
-                    << "constructor(input: Thrift.TJSONProtocol, output?: Thrift.TJSONProtocol);"
+      f_service_ts_ << ts_indent() << "private output: thrift.TTransport;" << endl
+                    << ts_indent() << "private pClass: thrift.TProtocol;" << endl
+                    << ts_indent() << "private _seqid: number;" << endl
+                    << endl
+                    << ts_indent() << "constructor(output: thrift.TTransport, pClass: { new(trans: thrift.TTransport): thrift.TProtocol });"
                     << endl;
     }
   } else {
@@ -1719,13 +1742,13 @@
 
     if (gen_ts_) {
       // function definition without callback
-      f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, false, false) << endl;
+      f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, false) << endl;
       if (!gen_es6_) {
         // overload with callback
-        f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true, false) << endl;
+        f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true) << endl;
       } else {
         // overload with callback
-        f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true, true) << endl;
+        f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true) << endl;
       }
     }
 
@@ -2669,7 +2692,7 @@
  * @param bool in-/exclude the callback argument
  * @return String of rendered function definition
  */
-std::string t_js_generator::ts_function_signature(t_function* tfunction, bool include_callback, bool optional_callback) {
+std::string t_js_generator::ts_function_signature(t_function* tfunction, bool include_callback) {
   string str;
   const vector<t_field*>& fields = tfunction->get_arglist()->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -2685,7 +2708,6 @@
   }
 
   if (include_callback) {
-    string callback_optional_string = optional_callback ? "?" : "";
     if (gen_node_) {
       t_struct* exceptions = tfunction->get_xceptions();
       string exception_types;
@@ -2694,19 +2716,19 @@
         for (vector<t_field*>::const_iterator it = members.begin(); it != members.end(); ++it) {
           t_type* t = get_true_type((*it)->get_type());
           if (it == members.begin()) {
-            exception_types = t->get_name();
+            exception_types = js_type_namespace(t->get_program()) + t->get_name();
           } else {
-            exception_types += " | " + t->get_name();
+            exception_types += " | " + js_type_namespace(t->get_program()) + t->get_name();
           }
         }
       }
       if (exception_types == "") {
-        str += "callback" + callback_optional_string + ": (error: void, response: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
+        str += "callback?: (error: void, response: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
       } else {
-        str += "callback" + callback_optional_string + ": (error: " + exception_types + ", response: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
+        str += "callback?: (error: " + exception_types + ", response: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
       }
     } else {
-      str += "callback" + callback_optional_string + ": (data: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
+      str += "callback?: (data: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
     }
 
     if (gen_jquery_) {
