changed implementation in snap methods
fixed C# issue with Arrays.compact
fixed platform specific issues