Fix ClassCastException

Issue related: https://github.com/Hidendra/LWC/issues/774

Xephi