Fixed crashing due to Object[] casting

This addresses the issue #15 I raised initially
I think it's best to revert the change.