Merging Vojin's changes and more tweaks