Tweaks and additions to the source