Fixed issue478
Merge pull request #531 from lilyfan/issue478

Fixed issue478