Cast fixes