Merged changes from mmuszkow