Fixed: Memory is correctly allocated when constructing LPWSTR or LPSTR from Java String. Unallocated memory caused NullPointerException. Tests for this fix added.