Tweaks and added debug info