[PATCH 2/2] Fix bug in add_master