several bufgixes and removed debug logging