Update code

Fixed bug for trunk.