updates error variable names and code formatting

code formatting uses:

if( var )   
becomes   
if (var)

use :: module.. 
becomes 
use module..