work on zbin: added binary limit, better error handling.