Added some checking around leading and training /'s and added tests to cover these cases