Fix overflow in procedure editor

Fixes #353.