Bug fix in free method.