Fixed bug with max_id and updated method names