some bug fixes
more tests
fixed casting error
using CastTo instead of CopyInto