Fix for #1257: spread args and type parameters

The old code was really a mess
Test for #1257: spread args and type parameters