Fixed malloc problem in sage 5.8