Fixed typo
Fixed invalid memory access
Fixed parameter value declarations