Fixed regex matching nicknames and added some more checking on function return.