Fix #37: allow up to 512KB