Sync'd with forum
Trivial code tweaks