Various fixes, mostly AVM1-related