Fix return code on failure to actually mean failure!
Several fixes based on PR review

- Use estrdup() rather then strdup() since this isn't used by mcon
- Magic numbers into math/comments
- Typo
- Strings into "constnts"