More debugging, some fixes