More debugging, more fixes