Fix region length bug. Change region length parameter to integer.