Fixed to secure type casting