atrac1: return appropriate error codes instead of -1