Fixed some problems with parameter passing (this was actually a type printing problem that lead to the appearance of a parameter passing problem). Also added more code for type checking.