cleanup some casts in navigation code