ada: Fix crashes and infinite loops

Fixes #56