Changed direct property references to use getter and added safety checks