Fixed some legacy code for meeting coding standard