Merged xale89's changes.