Fixes and debugging