Fixes and debug