Merged ukasz's pull request