Fixes and more debugging