Remove debug log + use external int for length checking