cast-local bugfix