Fix martin bugs