fix deprecated warnings (erasure => runtimeClass)

Hey Alex, I've fixed coupe of deprecated warnings I was getting every time I recompile it.
Thanks,
Eugene