Fix some warnings: some variables must be explictly declared as automatic; function return must be used to avoid warnings (Task and function usage is different in Verilog, function return value must be used).