Fixed some compilation issues with cygwin GCC.

(see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52015)
Add apply support for tuple and arrays