Fixed compilation error + additional minor cleanup