Merged changes from reskontr.