Initial tweaks from original source code