Fixed crashing due to Object[] casting

This addresses the issue #15 I raised initially
Redundant commented code. Please remove it.