Minor corrections on code