added a test for reversed partially applied functions, and added minor speedups to type conversiong