Fixed #1764 - thanks @torkeld
Removed sysout
added assert fail on ClassCastException
Merge pull request #1858 from noctarius/fixed-1764

Fixed #1764 - thanks @torkeld