Fixed casting bug
Merged