added type checking for c functions.  Fixed bug with moving things inside same table.