Fix stackoverflow bug in VM
explicit type cast
Merge pull request #514 from CJentzsch/bugfix

Fix stackoverflow bug in VM