Some tweaks and debugging

No big progress, a lot of these changes are temporary.