Standardized converted substring to substr callls and added a test