Bug fix. Resolve #327

Bug fix. Resolve #327