Improve getter. Fix compiler warnings.