* Add template version for As method. * Fix compilation error on Linux. * Fix linux issue (2). * Linux fix (3) * Add few tests.