Replacing deprecated function.
Minor - format code.
Fixing reporting for HRM and teachers see BT#7297