Fixed wrong casting (added comments to be removed later)