Minor tweaks and debugging