Fix bug due to return, remove undefined vars, add helper func for labeling.
Fix bug due to return, remove undefined vars, add helper func for labeling.

seanohue/ranviermud,shawncplus/ranviermud,seanohue/ranviermud