Fixed and modified after core-review.