Made generateUsername work on both iOS and OS X
Debug changes