Fixed returning pointer from a local buffer