Merging in onovy's changes into patch branch